# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V1.Model.XPSDataType do
  @moduledoc """
  Indicated the type of data that can be stored in a structured data entity (e.g. a table).

  ## Attributes

  *   `compatibleDataTypes` (*type:* `list(GoogleApi.Language.V1.Model.XPSDataType.t)`, *default:* `nil`) - The highly compatible data types to this data type.
  *   `listElementType` (*type:* `GoogleApi.Language.V1.Model.XPSDataType.t`, *default:* `nil`) - If type_code == ARRAY, then `list_element_type` is the type of the elements.
  *   `nullable` (*type:* `boolean()`, *default:* `nil`) - If true, this DataType can also be `null`.
  *   `structType` (*type:* `GoogleApi.Language.V1.Model.XPSStructType.t`, *default:* `nil`) - If type_code == STRUCT, then `struct_type` provides type information for the struct's fields.
  *   `timeFormat` (*type:* `String.t`, *default:* `nil`) - If type_code == TIMESTAMP then `time_format` provides the format in which that time field is expressed. The time_format must be written in `strftime` syntax. If time_format is not set, then the default format as described on the field is used.
  *   `typeCode` (*type:* `String.t`, *default:* `nil`) - Required. The TypeCode for this type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :compatibleDataTypes => list(GoogleApi.Language.V1.Model.XPSDataType.t()) | nil,
          :listElementType => GoogleApi.Language.V1.Model.XPSDataType.t() | nil,
          :nullable => boolean() | nil,
          :structType => GoogleApi.Language.V1.Model.XPSStructType.t() | nil,
          :timeFormat => String.t() | nil,
          :typeCode => String.t() | nil
        }

  field(:compatibleDataTypes, as: GoogleApi.Language.V1.Model.XPSDataType, type: :list)
  field(:listElementType, as: GoogleApi.Language.V1.Model.XPSDataType)
  field(:nullable)
  field(:structType, as: GoogleApi.Language.V1.Model.XPSStructType)
  field(:timeFormat)
  field(:typeCode)
end

defimpl Poison.Decoder, for: GoogleApi.Language.V1.Model.XPSDataType do
  def decode(value, options) do
    GoogleApi.Language.V1.Model.XPSDataType.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V1.Model.XPSDataType do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
